{{include file="header.html"}}
{{include file="menu.html"}}
	<div class="container">
		<div id="focus" class="focus">
			<div class="hd"><ul></ul></div>
			<div class="bd">
				<ul>
					{{if $carousel}}
					{{foreach item=val from=$carousel}}
					<li>
						<a href="javascript:;">
							<img _src="{{$val.image|photo}}"/>
						</a>
					</li>
					{{/foreach}}
					{{/if}}
				</ul>
			</div>
		</div>
		<script>
			TouchSlide({ 
				slideCell:"#focus",
				titCell:".hd ul", //开启自动分页 autoPage:true ，此时设置 titCell 为导航元素包裹层
				mainCell:".bd ul", 
				effect:"left", 
				autoPlay:true,//自动播放
				autoPage:true, //自动分页
				switchLoad:"_src" //切换加载，真实图片路径为"_src" 
			});
		</script>
		<!-- <div class="iconlinks">
			<table>
				<tr>
					<td><a href="index.php?app=Goods"><div><img src="{{$smarty.const.__APP__}}images/icon1.png" alt=""></div><span>新品</span></a></td>
					<td><a href="javascript:"><div><img src="{{$smarty.const.__APP__}}images/icon2.png" alt=""></div><span>限购</span></a></td>
					<td><a href="index.php?app=My&act=comment"><div><img src="{{$smarty.const.__APP__}}images/icon3.png" alt=""></div><span>晒单</span></a></td>
					<td><a href="javascript:"><div><img src="{{$smarty.const.__APP__}}images/icon4.png" alt=""></div><span>新手</span></a></td>
					<td><a href="index.php?app=Pay"><div><img src="{{$smarty.const.__APP__}}images/icon5.png" alt=""></div><span>充值</span></a></td>
				</tr>
			</table>
		</div> -->
		<!-- 最新揭晓 -->
		<div class="news">
			<div class="new_top">
				<a href="index.php?app=Goods">
					<div class="title">最新揭晓</div>
					<div class="newscroll">
						<div class="txtScroll-top">
							<div class="hd">
								<ul></ul>
							</div>
							<div class="bd">
								<ul class="infoList">
									{{if $result.rate}}
									{{foreach item=val from=$result.rate}}
										<li>{{$val.params.resume}}</li>
									{{/foreach}}
									{{/if}}
								</ul>
							</div>
						</div>

						<script type="text/javascript">
						jQuery(".txtScroll-top").slide({titCell:".hd ul",mainCell:".bd ul",autoPage:true,effect:"top",autoPlay:true,vis:1});
						</script>
					</div>
				</a>
			</div>
			<div class="newlist">
				<ul>
					{{if $result.rate}}
					{{foreach item=val from=$result.rate key=key}}
					<li>
						<a href="index.php?app=Goods&act=detail&id={{$val.id}}">
							<img src="{{$val.image|photo:145:105:ture}}" alt="">
							<!-- <span>倒计时{{$key+1}}</span>
							<span class="time count_down" count-down="{'endTime':'{{$val.rate}}','stopTips':'00:00:00'}">00:00:00</span> -->
						</a>
					</li>
					{{/foreach}}
					{{/if}}
				</ul>
				<div class="clear"></div>
			</div>
			<script type="text/javascript">
				$(".count_down").each(function(){
					var $this = $(this);
					var time = $this.attr('count-down');
					$this.countDown(eval('(' + time + ')'));
				})
			</script>
		</div>

		<!-- 新品推荐 -->
		<div class="intro">
			<div class="item">
				<span><img src="{{$smarty.const.__APP__}}images/star.png" alt="">新品推荐</span>
			</div>
			<div class="introbox">
				{{if $result.new}}
				{{foreach item=val from=$result.new key=key}}
				<div class="{{if key == '1'}}left{{else}}right{{/if}}">
					<a href="index.php?app=Goods&act=detail&id={{$val.id}}">
						<h3>{{$val.title}}</h3>
						<p>{{$val.params.resume}}</p>
						<img src="{{$val.image|photo}}" alt="">
					</a>
				</div>
				{{/foreach}}
				{{/if}}
			</div>
		</div>
		<!-- 猜你喜欢 -->
		<div class="like">
			<div class="item">
				<span><img src="{{$smarty.const.__APP__}}images/like.png" alt="">猜你喜欢</span>
			</div>
			<ul class="i_ul">
				{{if $result.love}}
				{{foreach item=val from=$result.love}}
				<li class="i_li">
					<a href="index.php?app=Goods&act=detail&id={{$val.id}}">
						<div class="img_inner">
							<img src="{{$val.image|photo}}">
						</div>
						<p class="i_txt">{{$val.title}}</p>
					</a>
					<div class="cont">			
						<div class="bom">
							<a onclick="addcart({{$val.id}})"><div class="cart"></div></a>
							<a href="javascript:" class="buybtn">立即运购</a>
						</div>
					</div>
				</li>
				{{/foreach}}
				{{/if}}
			</ul>
		</div>
		<!-- 点击加载 -->
		<div class="load">
			<a href="javascript:" onclick="more()">点击加载更多</a>
		</div>
	</div>
<script type="text/javascript">

	$(document).ready(function(){
		shop_cart();
	})

	//加载更多
	var page = 2;
	var more = true;
	if(more)
		function more(){
			$.get('{{"index.php?app=Index&act=more"|URL}}',{page:page},function(xml){
			if(xml.statusCode == '200'){
				$(".i_ul").append(xml.message);
				shop_cart();
				++page;
			}else{
				more = false;
				$(".load a").text(xml.message);
				}
	 		},'json');
		}
</script>
{{include file="footer2.html"}}